package com.aigou.admin.entity.vo;

import lombok.Getter;

/**
 * 响应状态枚举
 *
 * @Author: Hor
 * @Date: 2024/12/11 16:35
 * @Version: 1.0
 */
@Getter
public enum ResponseStatusEnum {

    //成功
    SUCCESS(200, "成功"),
    //失败
    FAIL(400, "失败"),
    BAD_REQUEST(400, "Bad Request"),
    //未认证
    UNAUTHORIZED(401, "认证失败"),
    //接口不存在
    NOT_FOUND(404, "接口不存在"),
    //服务器内部错误
    INTERNAL_SERVER_ERROR(500, "系统繁忙"),
    METHOD_NOT_ALLOWED(405,"方法不被允许"),

    // 业务错误
    /*参数错误:1001-1999*/
    PARAMS_IS_INVALID(1001, "参数无效"),
    PARAMS_IS_BLANK(1002, "参数为空");
    /*用户错误2001-2999*/

    private final Integer code;
    private final String message;

    ResponseStatusEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

}
